﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Admin.Admin.AdminMan
{
    public partial class AddAdmin : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            IsLogin();

            //验证是不是超级管理员，只有超级管理员才有权利访问页面
            if (!this.isSuperAdmin)
            {
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "您暂时没有权利访问该页面", "../AdminHelp.aspx");
                return;
            }
        }

        protected void Add_Click(object sender, EventArgs e)
        {
            NS.BLL.Admins adminBll = new NS.BLL.Admins();
            NS.Model.Admins adminModel = new NS.Model.Admins();
            adminModel.Account = this.AdminAccount.Text.Trim();
            adminModel.Password = this.Password.Text.Trim();
            int adminID = adminBll.Add(adminModel);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "添加成功", "AdminList.aspx");

        }
    }
}